#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

#define NOISY_TEST 1

void checkFeast_card(struct gameState *pre) {
  struct gameState post;
  int test;
  memcpy (&post, pre, sizeof(struct gameState));
  post.hand[0][0] = feast;
  test = playCard(0, adventurer, 0, 0, &post);
  printf("player 1 plays Feast incorrectly expecting to trade for adventurer\n");
  assert(test == -1);
  memcpy (&post, pre, sizeof(struct gameState));
  post.supplyCount[village] = 0;
  post.hand[0][0] = feast;
  test = playCard(0, village, 0, 0, &post);
  printf("player 1 plays Feast incorrectly expecting to buy a village when the card is bought out\n");
  assert(test == -1);
  memcpy (&post, pre, sizeof(struct gameState));
  post.hand[0][0] = feast;
  test = playCard(0, estate, 0, 0, &post);
  printf("player 1 plays Feast correctly expecting to buy an estate\n");
  assert(test == 0);
}

int main () {
  int k[10] = {adventurer, council_room, feast, gardens, mine,
	       remodel, smithy, village, baron, great_hall};
  struct gameState G;
  printf ("FIXED TESTING Feast Card.\n");
  initializeGame(4, k, 1, &G);
  checkFeast_card(&G);
  printf ("ALL TESTS OK\n");
  return 0;
}
